package cn.chen.sparkproject.dao.impl;

import cn.chen.sparkproject.dao.ISessionAggrStatDao;
import cn.chen.sparkproject.domain.SessionAggrStat;
import cn.chen.sparkproject.jdbc.JdbcHelper;

public class SessionAggrStatDaoImpl implements ISessionAggrStatDao{

    @Override
    public void insert(SessionAggrStat sessionAggrStat) {
        String sql = "insert into session_aggr_stat values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
        Object[] params = new Object[]{sessionAggrStat.getTaskid(),
                sessionAggrStat.getSessionCount(),
                sessionAggrStat.getVisit_length_1s_3s_radio(),
                sessionAggrStat.getVisit_length_4s_6s_radio(),
                sessionAggrStat.getVisit_length_7s_9s_radio(),
                sessionAggrStat.getVisit_length_10s_30s_radio(),
                sessionAggrStat.getVisit_length_30s_60s_radio(),
                sessionAggrStat.getVisit_length_1m_3m_radio(),
                sessionAggrStat.getVisit_length_3m_10m_radio(),
                sessionAggrStat.getVisit_length_10m_30m_radio(),
                sessionAggrStat.getVisit_length_30m_radio(),
                sessionAggrStat.getStep_length_1_3_radio(),
                sessionAggrStat.getStep_length_4_6_radio(),
                sessionAggrStat.getStep_length_7_9_radio(),
                sessionAggrStat.getStep_length_10_30_radio(),
                sessionAggrStat.getStep_length_30_60_radio(),
                sessionAggrStat.getStep_length_60_radio()
        };

        JdbcHelper jdbcHelper = JdbcHelper.getInstance();
        jdbcHelper.executeUpdate(sql, params);
    }

}
